package com.example.service;

import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

@Service
public class TestService {

    @Cacheable(cacheNames = "add",key = "#p0")//Cache是发生在cache1上的
    public String add(String str){
        System.out.println("add ....");
        return "耗子尾纸";
    }

    public void subtract(){
        System.out.println("subtract...");
    }

    public void cheng(){
        System.out.println("TestService.cheng");
    }
}
